#ifndef RGBCONTROL_H_INCLUDED
#define RGBCONTROL_H_INCLUDED

#include "Peripherals.h"

#define WHITE           0xffffff
#define BLACK           0x010101

#define YELLOW          0xffff01
#define DARKGOLDENROD   0xb8860b
#define GOLD            0xffd700

#define ORANGE          0xffa501
#define CORAL           0xff7f50
#define TOMATO          0xff6347

#define NBLUE            0x0101ff
#define SKYBLUE         0x87ceeb
#define NAVY            0x010180

#define DARKGREEN       0x016401
#define FORESTGREEN     0x228b22
#define LIGHTSEEGREEN   0x20b2aa

#define PINK            0xffc0cb
#define PURPLE          0xa020f0
#define VIOLET          0xee82ee

#define STEPS 1000

#define SCALE_FACTOR 5

typedef struct Color {
    uint8_t red;
    uint8_t green;
    uint8_t blue;
} Color;

void initColor(void);
void setColor(Color *c, uint32_t newColor);
void setFutureColor(uint32_t newColor);
void updateColor(void);
void InterpolateRed(void);
void InterpolateGreen(void);
void InterpolateBlue(void);
void InterpolateColor(void);
uint8_t checkDone(void);

unsigned char extractRED(unsigned long color);
unsigned char extractGREEN(unsigned long color);
unsigned char extractBLUE(unsigned long color);

#endif // RGBCONTROL_H_INCLUDED
